Add compatibility with PHP 8.4 Dom\HTMLDocument#7
Add compatibility with PHP 8.4 Dom\HTMLDocument#7ddebin wants to merge 3 commits intobrick:masterfrom
Conversation
|
@ddebin Firstly thanks for picking this up! FYI I left the afformentioned PR in draft because my understanding of using the
From https://www.php.net/manual/en/dom-htmldocument.createfromstring.php Do you properly understand the implications of using this constant? |
|
@adamjgriffith I'm not an expert. I see this option as a way to treat HTML5 as a proper XML DOM, but it's not. Per https://stackoverflow.com/a/79443754/377645, it seems HTML_NO_DEFAULT_NS should have been the default way, as 99% of cases need this option. |
|
Some explanation here:
With HTML_NO_DEFAULT_NS, HTML elements are not placed in this namespace. It may impact the way of parsing and the DOM structure, but in this project, parsing is done (example) without a namespace. |
Inspired by #5, keep backward DOMDocument compatibility for PHP <8.4.
I can add a PR to
brick/schema(to allow passing aDom\Document) if accepted.